package com.sumer.psychology.space.infrastructure.port.adapter;

import com.google.gson.Gson;
import com.sumer.psychology.common.domain.model.User;
import com.sumer.psychology.common.media.RepresentationReader;
import com.sumer.psychology.sharing.domain.model.SharedResource;

import java.lang.reflect.Constructor;

/**
 * json转成SharedResource
 * <p/>
 * User: zhenguang.zhu
 * Date: 2014/12/3
 * Time: 9:12
 */
public class SharedResourceTranslator {
    private static final Gson gson = new Gson();

    /**
     * 转换
     *
     * @param aSharedResourceRepresentation representation
     * @return shared resource
     */
    public SharedResource toSharedResourceFromRepresentation(String aSharedResourceRepresentation) {
        return gson.fromJson(aSharedResourceRepresentation, SharedResource.class);
    }

}
